home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Return type - array of structures - please help!
- Date: 16 Apr 1996 15:53:14 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4l18cqINNfmj@keats.ugrad.cs.ubc.ca>
- References: <4l0c9g$tsr@thorn.cc.usm.edu>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4l0c9g$tsr@thorn.cc.usm.edu>,
- Michael Kirgan <mkirgan@pacific.st.usm.edu> wrote:
- >I wish to make the function called delete to return an array of
- >structures or if that is not possible at least create it so when
-
- It is not possible.
-
- >I pass an array of structures, it is by reference and not value like
- >listed below.
- >
- >Here is an expample of my code:
- >
- >typdef struct
- > {
- > char ssn[12];
- > char lastname[15];
- > char firstname[15];
- > char data[10];
- > } student;
- >
- >void delete(char [], class [])
-
- This function header is illegal. The ``char []'' lacks a parameter declarator
- name. It should be something like ``char string[]'' or something like that.
- Secondly, the ``class'' identifier is not even declared. Are you using some
- weird pre-processing tricks to make the above work? Such as,
-
- #define char char A
- #define class char B
-
- >The above code works, but it passes by value, so changes are not passed back.
-
- Are you kidding? How can it work when it's not even valid C! It won't compile
- in any C environment that I have ever used. Are you sure you have the right
- newsgroup?
-
- Please rewrite your program in C, try your best to get it to compile with a C
- language compiler to eliminate as many errors and warnings as you can, and then
- ask again.
- --
- I'm not really a jerk, but I play one on Usenet.
-